package com.baizhi.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("interceptor")
public class InterceptorController {
    @RequestMapping("login")
    public String login(String username, String password, HttpSession session){
        System.out.println(username);
        if("zxs".equals(username) && "123".equals(password)){
            session.setAttribute("login",username);
            return "redirect:/ok.html";
        }
        return "redirect:/login.html";
    }
}
